<?php
/**
 * Created by PhpStorm
 * User: lcz
 * Date: 2019/10/26
 * Time: 15:25
 * 意见反馈
 */
namespace app\api\controller;

use app\common\controller\Api;

class Feedback extends Api {
	
	/**
	 * 添加
	 */
	public function add() {
		$content = $this->request->post('content');
		!$content && $this->error('反馈内容不能为空');
		
		$model = new \app\common\model\Feedback();
		$res = $model->isUpdate(false)
			->save([
				'user_id' => $this->auth->id,
				'content' => $content
			]);
		if($res) {
			$this->success('感谢你的反馈');
		} else {
			$this->error('保存出错，请稍候重试');
		}
	}
}
